package com.micro.ai.template.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 模板评分实体（调整后）
 *
 * @author micro-ai
 * @since 0.0.1
 * @version 2.0 支持多租户
 */
@Data
@TableName("template_ratings")
@Schema(description = "模板评分实体")
public class TemplateRating {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键ID")
    private String id;

    @TableField("template_id")
    @Schema(description = "模板ID")
    private String templateId;

    // ============================================================================
    // ✅ 多租户和用户关联
    // ============================================================================

    @TableField("tenant_id")
    @Schema(description = "所属租户ID", example = "tenant_001")
    private String tenantId;

    @TableField("user_id")
    @Schema(description = "用户ID", example = "usr_001")
    private String userId;

    @TableField("rating")
    @Schema(description = "评分(1-5)", example = "5")
    private Integer rating;

    @TableField("comment")
    @Schema(description = "评论内容")
    private String comment;

    @TableField("helpful_count")
    @Schema(description = "有用数", example = "0")
    private Integer helpfulCount;

    @TableField("created_at")
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    @TableField("updated_at")
    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;
}
